#-*-encoding=utf-8-*-
steps = [
    FlowStep(
        name=u'init',
        title=u'出车申请',
        fields=[u'type', u'name', u'driver', u'dept', u'remark', u'deptManager', u'director'],
        responsibles=u'sheet is None and request.principal.id or sheet["creators"]',
    actions=[
        FlowStepAction(
            name=u'submit',
            title=u'提交',
            nextsteps=[u'review'],
            trigger=ur"""## set tags 
sheet['subjects'] = [u'Booked', sheet['type']]
IObjectIndexer(sheet).reindexObject()
"""
)
])
,

    FlowStep(
        name=u'review',
        title=u'部门负责人',
        fields=[u'type', u'date', u'time', u'name', u'driver', u'dept', u'remark', u'director'],
        responsibles=u'sheet["deptManager"]',
    actions=[
        FlowStepAction(
            name=u'accept',
            title=u'通过',
            nextsteps=[u'533780']
),

        FlowStepAction(
            name=u'reject',
            title=u'打回',
            nextsteps=[u'init'],
            finish_condition=u''
)
])
,

    FlowStep(
        name=u'533780',
        title=u'办公室主人',
        fields=[u'type', u'date', u'time', u'name', u'driver', u'dept', u'remark', u'deptManager'],
        responsibles=u"sheet['director'] ",
    actions=[
        FlowStepAction(
            name=u'677352',
            title=u'申请通过',
            nextsteps=[],
            trigger=ur"""## set tags
sheet['subjects'] = [u'Finished', sheet['tyle']]
IObjectIndexer(sheet).reindexObject()"""
),

        FlowStepAction(
            name=u'522251',
            title=u'打回',
            nextsteps=[u'init'],
            trigger=ur"""## set tags
sheet['subjects'] = [u'Booked', sheet['type']]
IObjectIndexer(sheet).reindexObject()"""
)
])
]
